package com.example.demo.service;

import com.example.demo.mapper.UserMapper;
import com.example.demo.model.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 25228
 * Date: 2025-06-05
 * Time: 17:48
 */
@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;
    public Boolean checkPassword(String name, String password) {
        //查询用户信息
        UserInfo userInfo=userMapper.queryInfoByName(name);
        if (userInfo==null||userInfo.getId()<=0){
            return false;
        }
        //校验用户信息是否正确
        return userInfo.getPassword().equals(password);
    }
}
